Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: commitments/by-index/:index/blocks route should return only finalized blocks #1385

Merged

Conversation

Alex6323
Copy link
Collaborator

@Alex6323 Alex6323 commented Apr 26, 2024

Currently in the explorer route commitments/by-index/:index/blocks blocks are already shown, when they are just accepted, but not yet finalized. This PR generalizes the corresponding routes handler (that forwards the query to MongoDb) to additionally provide the block state. For the Explorer API specifically that means, that the handler internally sets the added block_state parameter to Some(BlockState::Finalized).

We could also not do it like this, but instead make this mongodb query specific to finalized blocks, but then it would be specifc to the explorer api which I didn't like that much, but I am open to change it if wanted.

UPDATE: this PR was changed to only store blocks if and when they are finalized. Hence, we removed the corresponding block state analytic.

@Alex6323 Alex6323 marked this pull request as draft April 26, 2024 13:38
@Alex6323 Alex6323 marked this pull request as ready for review April 26, 2024 13:58
@Alex6323 Alex6323 requested a review from DaughterOfMars April 26, 2024 13:58
@Alex6323 Alex6323 marked this pull request as draft April 30, 2024 10:47
@Alex6323 Alex6323 force-pushed the fetch-finalized-blocks-in-explorer branch from 67ebdb9 to 343285b Compare April 30, 2024 10:49
@Alex6323 Alex6323 marked this pull request as ready for review May 2, 2024 08:02
@DaughterOfMars DaughterOfMars merged commit 18b69fd into iotaledger:2.0 May 6, 2024
6 checks passed
@Alex6323 Alex6323 deleted the fetch-finalized-blocks-in-explorer branch May 6, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants